package PracticeFinal;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

public class test {
    public static void main(String[] args) {

        Connection connection = null;
        PreparedStatement pstmt = null;
        ResultSet resultSet = null;

        connection = JDBCUtils.getConnection();
        String sql = "select * from employee";
        try {
            pstmt = connection.prepareStatement(sql);

            resultSet = pstmt.executeQuery();
            while (resultSet.next()){
                String yearMonth = resultSet.getString(1);
                String employeeId = resultSet.getString(2);
                String employeeName = resultSet.getString(3);
                int wage = resultSet.getInt(4);
                int allowance = resultSet.getInt(5);
                System.out.println(yearMonth+employeeId+employeeName+wage+allowance);
            }
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }
        System.out.println(pstmt+"///////"+connection);
        JDBCUtils.close(resultSet,pstmt,connection);
    }
}
